package com.snow.demo.spring.lifecycle;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

/**
 * @author -J
 * @since 2024/1/20 20:32
 */
public class LifeCycleBean implements InitializingBean, DisposableBean {


    public void beanInit(){
        System.out.println("beanInit");
    }

    public void beanDestroy(){
        System.out.println("beanDestroy");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("调用DisposableBean的destroy方法");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("调用InitializingBean afterPropertiesSet");
    }
}
